package cn.kgc.junketing.consumerfeign.vo;

public class ResponseBean {
    private Integer code;
    private String message;
    private Object object;

    //  成功
    public static ResponseBean success(ResponseBeanEnum responseBeanEnum) {
        return new ResponseBean(responseBeanEnum.getCode(), responseBeanEnum.getMessage());
    }

    //  成功
    public static ResponseBean success(ResponseBeanEnum responseBeanEnum, Object object) {
        return new ResponseBean(responseBeanEnum.getCode(), responseBeanEnum.getMessage(), object);
    }

    //  失败
    public static ResponseBean error(ResponseBeanEnum responseBeanEnum, Object object) {
        return new ResponseBean(responseBeanEnum.getCode(), responseBeanEnum.getMessage(), object);
    }

    //  失败
    public static ResponseBean error(ResponseBeanEnum responseBeanEnum) {
        return new ResponseBean(responseBeanEnum.getCode(), responseBeanEnum.getMessage());
    }

    public ResponseBean() {
    }

    public ResponseBean(Integer code) {
        this.code = code;
    }

    public ResponseBean(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseBean(Integer code, String message, Object object) {
        this.code = code;
        this.message = message;
        this.object = object;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }
}
